package com.adnaan.backend.mapper;

import com.adnaan.backend.entity.Dishes;
import com.adnaan.backend.entity.DishesSteps;
import com.adnaan.backend.entity.dto.DosageDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DishesMapper extends BaseMapper<Dishes> {
    List<DosageDto> getDosage(@Param("dishId") Long id);

    List<DishesSteps> getSteps(@Param("dishId") Long id);

    boolean deleteDosage(@Param("dishId") Long dishId);

    void addMaterial(@Param("dishId") Long dishId, @Param("materialId") Long materialId, @Param("dosage") String dosage);

    boolean deleteMaterial(@Param("dishId") Long dishId, @Param("materialId") Long materialId);

    boolean insertStep(@Param("dishSteps") DishesSteps dishesSteps);

    boolean updateStep(@Param("dishSteps") DishesSteps dishesSteps);

    void deleteSteps(@Param("dishId") Long dishId);

    List<Dishes> selectDishesByHerbalId(@Param("herbalId") Long herbalId);
}
